package org.sscn.persistence.entities;

// Generated Aug 12, 2013 12:44:57 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * RefPns generated by hbm2java
 */
@Entity
@Table(name = "ref_pns", catalog = "dbseleksicpns", uniqueConstraints = @UniqueConstraint(columnNames = "NIP"))
public class RefPns implements java.io.Serializable {

	private RefPnsId id;
	private RefInstansi refInstansi;

	public RefPns() {
	}

	public RefPns(RefPnsId id, RefInstansi refInstansi) {
		this.id = id;
		this.refInstansi = refInstansi;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "nip", column = @Column(name = "NIP", unique = true, nullable = false, length = 18)),
			@AttributeOverride(name = "nama", column = @Column(name = "NAMA", nullable = false, length = 100)),
			@AttributeOverride(name = "instansi", column = @Column(name = "INSTANSI", nullable = false, length = 4)),
			@AttributeOverride(name = "status", column = @Column(name = "STATUS", nullable = false, length = 1)) })
	public RefPnsId getId() {
		return this.id;
	}

	public void setId(RefPnsId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "INSTANSI", nullable = false, insertable = false, updatable = false)
	public RefInstansi getRefInstansi() {
		return this.refInstansi;
	}

	public void setRefInstansi(RefInstansi refInstansi) {
		this.refInstansi = refInstansi;
	}

}
